package Rule;

import java.util.regex.Pattern;

import Frame.ManagerPanel;

public class PatternCompile {
	
	/**
	 * 判断是否是小数
	 * @param str 数值
	 * @return true or false
	 */
	public static boolean isDecimal(String str){  
		  return Pattern.compile("([1-9]+[0-9]*|0)(\\.[\\d]+)?").matcher(str).matches();  
		 }  
	
	/**
	 * 判断是否为数字
	 * @param str 数值
	 * @return true or false
	 */
	public static boolean isIntger(String str){
		return Pattern.compile("^[0-9]*$").matcher(str).matches();
	}
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String a = "12 3130";
		System.out.println(isIntger(a));
		
	}
}
